<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js示例4-6-5</title>
	<script>
		var n, jieCheng = 1;
		n = prompt("请输入一个自然数" , "");
		for(var i = 1; i <= n; i ++){
			jieCheng = jieCheng * i;
		}
		alert(n + "!" + "=" + jieCheng);
	</script>
</head>
<body>
	
</body>
</html>